package com.order.mapper;


import com.order.bean.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.aspectj.weaver.ast.Or;

import java.util.List;

/**
 * Description:
 *
 * @author weiruibai.vendor
 * Date: 2022/9/14 23:50
 */
public interface OrderMapper {

    @Insert("insert into t_order (user_id,user_name,create_at) values (#{userId},#{userName},#{createAt})")
    Integer insert(Order order);

    @Select("select id , user_id as userId,user_name as userName,create_at as createAt from t_order where user_id= #{id}")
    Order get(@Param("id") int id);

    @Select("elect id , user_id as userId,user_name as userName,create_at as createAt from t_order")
    List<Order> getList();
}
